package Classing;

import java.util.Stack;

public class test1 {
    public static int partition(int[] array,int left,int right) {
        return 0;
    }
    public static void quickSortNor(int[] array) {
        int left = 0;
        int right = array.length - 1;
        int pivot = partition(array,left,right);

        Stack<Integer> stack = new Stack<>();
        if(pivot - 1 > left) {
            stack.push(left);
            stack.push(pivot-1);
        }
        if(pivot + 1 < right) {
            stack.push(pivot+1);
            stack.push(right);
        }
        while(!stack.isEmpty()) {
            right = stack.pop();
            left = stack.pop();
            pivot = partition(array,left,right);
            if(pivot - 1 > left) {
                stack.push(left);
                stack.push(pivot-1);
            }
            if(pivot + 1 < right) {
                stack.push(pivot+1);
                stack.push(right);
            }
        }
    }
 }
